<%@ page contentType="text/html; charset=UTF-8"	pageEncoding="UTF-8" %>
<%@ page import="com.yaodian100.core.common.utils.ServerValue" %>
<%@ page import="org.apache.commons.lang.math.RandomUtils"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c-rt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt-rt" %>
<%@ taglib uri="/WEB-INF/tld/mallutil.tld" prefix="mu" %>
<%@ taglib uri="/WEB-INF/tld/pageutil.tld" prefix="pu" %>
<%@ taglib uri="/WEB-INF/tld/importTag.tld" prefix="importTag" %>
<script type="text/javascript" charset="UTF-8" src="/js/outlets.js"></script>
<c-rt:set var="imgDomain" value="<%=ServerValue.getImgDomain()%>" />
<c-rt:set var="hostName" value="<%=ServerValue.getFrontHostname()%>" />
<c-rt:set var="frontendContextPath" value="<%=ServerValue.getFrontContextPath()%>" />
<!--[if lt IE 7]>
<script type="text/javascript" src="/js/supersleight-min.js"></script>
<![endif]-->

<script type="text/javascript">
	$().ready(function(){
		var sharepath="${hostName}${frontendContextPath}";
		var pathname=sharepath+window.location.pathname;
		if(pathname.indexOf("activity.do")!=-1){
			$("#navBar1").attr("class","tab-f");
		}else{
			$("#navBar1").attr("class","");
		}
		if(pathname.indexOf("history.do")!=-1){
			$("#navBar2").attr("class","tab-f");
		}else{
			$("#navBar2").attr("class","");
		}
		$("#navBar3").attr("class","");
		
		$("#shareLink").attr("value",pathname+"?hpp=share");
		
		//ShareBar
		$("#kaixinShare").click(function(){
			traceVirtualPage(pathname+'?hpp=tgkaixinmck');
			window.open('http://www.kaixin001.com/repaste/share.php?rtitle='+encodeURIComponent('我在 耀点100 网站发现团购活动很不错，推荐给大家！')+'&rurl='+encodeURIComponent('+pathname+')+'&rcontent=' + encodeURIComponent('${fn:escapeXml(happyText)}') ,'_blank','scrollbars=no,width=600,height=450,left=75,top=20,status=no,resizable=yes');
			void 0;
		});
		
		$("#renrenShare").click(function(){
			traceVirtualPage(pathname+'?hpp=tgrenrenmck');
			void((function(s,d,e){var f='http://share.renren.com/share/buttonshare?link=',u=pathname+'?hpp=renren',l='',p=[e(u),'&title=',e(l)].join('');function a(){if(!window.open([f,p].join(''),'xnshare',['toolbar=0,status=0,resizable=1,width=626,height=436,left=',(s.width-626)/2,',top=',(s.height-436)/2].join('')))u.href=[f,p].join('');};if(/Firefox/.test(navigator.userAgent))setTimeout(a,0);else a();})(screen,document,encodeURIComponent));
		});
		
		$("#qqShare").click(function(){
			traceVirtualPage(pathname+'?hpp=tgqqmck');
			
			var _t = encodeURI('${fn:escapeXml(happyText)}');
			var _url = encodeURIComponent(pathname);
			var _appkey = encodeURI("67523a5364aa43bdb6e8d18f93ac5524");
			var picUrl = '${imgDomain}'+$('.logo').attr('src');
			var _pic = encodeURI(picUrl);
			var _site = '${hostName}';
			var _u = 'http://v.t.qq.com/share/share.php?url='+_url+'&appkey='+_appkey+'&site='+_site+'&pic='+_pic+'&title='+_t;
			window.open( _u,'', 'width=700, height=680, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, location=yes, resizable=no, status=no' );
		});
		
		$("#sinaShare").click(function(){
			traceVirtualPage(pathname+'?hpp=sinamck');
			window.open('http://v.t.sina.com.cn/share/share.php?appkey=732367816&title='+encodeURIComponent('我在 耀点100 网站发现团购活动很不错，推荐给大家！'+pathname) ,'_blank','scrollbars=no,width=600,height=450,left=75,top=20,status=no,resizable=yes');
			void 0;
		});
		
		$(document).keyup(function (e) { 
			if(e.which == 17) isCtrl=false; }
		).keydown(function (e) { 
			if(e.which == 17) isCtrl=true; 
			if(e.which == 67 && isCtrl == true) {
				$("#alertShareFail").hide(); 
				$("#alertShareSuccess").attr("style","display:block");
				$(".sharebylink").attr("style","display:block");
			} 
		});
		
		$(".sharebylink").hide();
		$("#alertShareSuccess").hide();
		$("#alertShareFail").hide();
		
		$("#closeShare").click(function(){
			$(".sharebylink").hide();
		});
		
		$("#copyShare").click(function(){
			traceVirtualPage(pathname+'?hpp=tgcopymck');
			
			var B=(function x(){})[-5]=='x'?'FF3' : (function x(){})[-6]=='x'?'FF2':/a/[-1]=='a'?'FF':'\v'=='v'?'IE':/a/.__proto__=='//'?'Saf':/s/.test(/a/.toString)?'Chr':/^function \(/.test([].sort)?'Op':'Unknown'
				if ( B != 'IE' ){
					$(".sharebylink").attr("style","display:block");
					$("#alertShareFail").attr("style","display:block");
				}else{
					document.getElementById("shareLink").createTextRange().execCommand("Copy");
					$("#alertShareSuccess").attr("style","display:block");
					$(".sharebylink").attr("style","display:block");
				}
				$('#shareLink').select();
		});
	});
</script>